
import authentication.EncryptionType;
import connection.Account;
import connection.IReceiver;
import data.AccountData;
import data.email.AccountType;
import data.email.EmailFolder;
import java.util.List;

/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
/**
 *
 * @author Pavel
 */
public class pop3test {

    public static void main(String[] args) {
        AccountData ad = new AccountData();
        ad.setEncryption(EncryptionType.SSL);
        ad.setLogin("pokusnykralik007@email.cz");
        ad.setPass("test123");
        ad.setServer("pop3.seznam.cz");
        ad.setType(AccountType.POP3);
        try {
            Account a = Account.createAccount(ad);
            List<EmailFolder> lf = ((IReceiver) a).loadAllFolders();
            System.out.println(lf.size());
            for (EmailFolder f : lf) {
                System.out.println(f.getName());
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println(e.getMessage());
        }
    }
}
